<template>
	<view class="">
		<view class="nav bgf pl32 flex_x" @click="selectCity">
			<view class="flex_x">
				<image class="img32" src="/static/classify/wz.png" mode=""></image>
			</view>
			<view class="ml12 mr6 c3 fw500 fs28">当前位置</view>
			<view class="flex_x mt6">
				<u-icon name="arrow-down-fill" color="#333333" size="24rpx"></u-icon>
			</view>
		</view>

		<view class="mt24">
			<view class="shop p2432 bgf mb24 br12" v-for="item in list" @click="selectShop(item)">
				<view class="c3 fw600 fs30">{{item.title}}</view>

				<view class="mt24 flex_btw">
					<view class="flex_x flex1">
						<image class="img24" src="/static/classify/dz.png" mode=""></image>
						<view class="ml4 c9 fw500 fs24 ml12 flex1">{{item.address}}{{item.detailed}}</view>
					</view>
					<view class="flex_x ml20">
						<image class="img24" src="/static/classify/map.png" mode=""></image>
						<view class="ml4 c2a7 fw500 fs24">距您{{item.distance}}m</view>
					</view>
				</view>

				<view class="mt24 flex_x">
					<image class="img24" src="/static/classify/sj.png" mode=""></image>
					<view class="ml4 c9 fw500 fs24 ml12 flex1">营业时间：{{item.workrange}}</view>
				</view>
			</view>
		</view>
		<pullUp :status='state'></pullUp>
	</view>
</template>

<script>
	import {
		pageSize
	} from '@/components/minxins.js' //引入minxins
	export default {
		mixins: [pageSize],
		components: {},
		data() {
			return {
				list: [], //店铺列表
			}
		},
		onLoad(options) {
			this.method_name = 'shopList'
			this.query = {
				lat: options.lat,
				lng: options.lng,
			}
			this.getList();
		},
		onShow() {

		},
		methods: {
			selectCity() { //选择地址
				console.log(88);
				uni.chooseLocation({
					success: (res) => {
						// console.log(res);
						this.latitude = res.latitude
						this.longitude = res.longitude

						this.query = {
							lat: res.latitude,
							lng: res.longitude,
							page: 1,
						}
						this.getList();
					}
				});
			},
			selectShop(item) { //选择门店
				this.$store.commit('saveShop', item)
				uni.navigateBack()
			}
		},
		computed: {

		},
		watch: {

		}
	}
</script>

<style lang="scss" scoped>
	.nav {
		height: 88upx;
	}

	.shop {
		box-shadow: 0px 2upx 4upx 0px rgba(0, 0, 0, 0.1);
	}
</style>
